{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "import sys\n",
    "from numpy import *\n",
    "from svm import *\n",
    "from os import listdir\n",
    "import datatime"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "class PlattSMO\n",
    "    def __int__(self,dataMat,classlabels,C,toler,maxIter,**kernelargs):\n",
    "        self.x = array(dataMat)\n",
    "        self.label = array(classlabels)\n",
    "        self.C = C\n",
    "        self.toler = toler\n",
    "        self.maxIter = maxIter\n",
    "        self.m = shape(dataMat)[0]\n",
    "        self.n = shape(dataMat)[1]\n",
    "        self.alphas = array(zeros(self.m),dtype='float64')\n",
    "        self.b = 0.0\n",
    "        self.eCache = array(zeros((self.m,2)))\n",
    "        self.K = zeros((self.m,self.m),dtype='float64')\n",
    "        self.kwargs = kernelargs\n",
    "        self.SV = ()\n",
    "        self.SVIndex = None\n",
    "\n",
    "        for i in range(self.m):\n",
    "            for j in range(self.m):\n",
    "                self.K[i,j] = self.kernelTrans(self.x[i,:],self.x[j,:],self.x[j,:])\n",
    "\n",
    "    def calcEK(self, k):\n",
    "        fxk = dot(self.alphas * self.label,self.K[:,k]) + self.b\n",
    "\n",
    "\n"
   ]
  }
 ],
 "metadata": {
  "language_info": {
   "name": "python"
  },
  "orig_nbformat": 4
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
